---
title: "Create a fulfillment."
method: POST
path: "/admin/orders/{order_id:[0-9]+}/fulfillments.json"
tags: ["Fulfillment"]
---

# Create a fulfillment.

`POST /admin/orders/{order_id:[0-9]+}/fulfillments.json`

Create a fulfillment for the specified order and line items.

The fulfillment's status depends on the line items in the order:

* If the line items in the fulfillment use a manual or custom fulfillment service, then the status of the returned fulfillment will be set immediately.

* If the line items use an external fulfillment service, then they will be queued for fulfillment and the status will be set to pending until the external fulfillment service has been invoked.

A fulfillment might then transition to **open**, which implies it is being processed by the service, before transitioning to **success** when the items have shipped. If you don't specify line item IDs, then all unfulfilled and partially fulfilled line items for the order will be fulfilled. However, if an order is refunded or if any of its individual line items are refunded, then the order can't be fulfilled.

## Path parameters

- `order_id` integer, required

## Request body

- FulfillRequestWrapperSwagger
  - `fulfillment` FulfillRequestSwagger
    - `line_items` LineItemFulfillRequestSwagger[] — Tracking number of fulfillment
      - `id` integer — Id of line item which belong to order
      - `quantity` number — Quantity want to fulfill, if not provide, quantity will be line item fulfillable quantity
    - `service` string — Service name of fulfillment
    - `shipment_status` string — The current shipment status of fulfillment
    - `tracking_company` string — Tracking company of fulfillment
    - `tracking_number` string — Tracking number of fulfillment
    - `tracking_url` string — Tracking url of fulfillment, only use one of `tracking_url` and `tracking_urls`
    - `tracking_urls` string[] — Tracking urls of fulfillment, only use one of `tracking_url` and `tracking_urls`

## Response `200`

OK

- FulfillmentDto
  - `claim_id` integer — the claim id of fulfillment
  - `created_at` integer — The date and time when the fulfillment was created. The API returns this value in ISO 8601 format.
  - `date_done` integer — The date and time (ISO 8601 format) when the fulfillment was fulfilled.
  - `detected_tracking_company` string — Detected tracking company
  - `first_tracking_step_at` integer — The date and time when the first tracking step created
  - `id` integer — The ID for the fulfillment.
  - `last_crawled_at` integer — The date and time when the fulfillment was last crawled
  - `last_mile_tracking_company` string — The tracking company when the package arrived at destination country
  - `last_mile_tracking_number` string — The tracking number of packages when arrived at destination country
  - `last_tracking_step_at` integer — The date and time when the last tracking step created
  - `name` string — The uniquely identifying fulfillment name, consisting of two parts separated by a `.`. The first part represents the order name and the second part represents the fulfillment number. The fulfillment number automatically increments depending on how many fulfillments are in an order (e.g. #1001.1, #1001.2).
  - `notify_customer` boolean — Whether the customer should be notified. If set to true, then an email will be sent when the fulfillment is created or updated. For orders that were initially created using the API, the default value is false. For all other orders, the default value is true.
  - `order_id` integer — The unique numeric identifier for the order.
  - `send_delay_mail` boolean — check send email delay shipping
  - `service` string — The uniquely identifying fulfillment name, consisting of two parts separated by a `.`. The first part represents the order name and the second part represents the fulfillment number. The fulfillment number automatically increments depending on how many fulfillments are in an order (e.g. #1001.1, #1001.2).
  - `shipment_status` string — The current shipment status of the fulfillment. Valid values </br>**label_printed**: A label for the shipment was purchased and printed. </br>**label_purchased**: A label for the shipment was purchased, but not printed. </br>**attempted_delivery**: Delivery of the shipment was attempted, but unable to be completed. </br>**ready_for_pickup**: The shipment is ready for pickup at a shipping depot. </br>**confirmed**: The carrier is aware of the shipment, but hasn't received it yet. </br>**in_transit**: The shipment is being transported between shipping facilities on the way to its destination. </br>**out_for_delivery**: The shipment is being delivered to its final destination. </br>**delivered**: The shipment was succesfully delivered. </br>**failure**: Something went wrong when pulling tracking information for the shipment, such as an invalid tracking number or the shipment was cancelled.
  - `status` string — The status of the fulfillment. Valid values </br>**pending**: The fulfillment is pending. </br>**open**: The fulfillment has been acknowledged by the service and is in processing. </br>**success**: The fulfillment was successful. </br>**cancelled**: The fulfillment was cancelled. </br>**error**: There was an error with the fulfillment request. </br>**failure**: the fulfillment request failed. </br>**processing**: the fulfillment request is in processing.
  - `tracking_company` string — The name of the tracking company.
  - `tracking_number` string — A trackping number, provided by the shipping company
  - `tracking_numbers` string[] — A list of tracking numbers, provided by the shipping company.
  - `tracking_steps` object — Tracking steps object
  - `tracking_url` string — Link to tracking pag
  - `tracking_urls` string[] — The URLs of tracking pages for the fulfillment.
  - `updated_at` integer — The date and time (ISO 8601 format) when the fulfillment was last modified.
  - `variant_inventory_management` string — The name of the inventory management service.

---

[API](https://skmtc.net/shopbase/apis/shopbase-internal-api.md) · [All operations](https://skmtc.net/shopbase/apis/shopbase-internal-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/shopbase/shopbase-internal-api/revisions/353ccde6240d/schema)
